export function useToast() {
  const showToast = (
    title: string, 
    icon: 'success' | 'loading' | 'error' | 'none' = 'none',
    duration: number = 1500
  ) => {
    uni.showToast({ title, icon, duration })
  }

  const showLoading = (title: string = '加载中') => {
    uni.showLoading({ title })
  }

  const hideLoading = () => {
    uni.hideLoading()
  }

  const hideToast = () => {
    uni.hideToast()
  }

  return { 
    showToast, 
    showLoading, 
    hideLoading, 
    hideToast 
  }
}